Import mojo
Import diddy
Import model

Class SplashScreen Extends Screen
	Const STATE_LOAD_SPLASH:Int = 0
	Const STATE_SHOW_SPLASH:Int = 1
	Const STATE_LOAD_ASSETS:Int = 2
	Const STATE_START_GAME:Int = 3
	
	Field currentState:Int = STATE_LOAD_SPLASH
	
	Method New()
		name = "SplashScreen"
		
	End
	 
	Method Start:Void()
		
	End
	
	Method Update:Void()
		Select currentState
			Case STATE_LOAD_SPLASH
				SetFont(LoadImage("graphics/font_16.png",16,16,64))
				currentState=STATE_SHOW_SPLASH
			Case STATE_SHOW_SPLASH
				currentState=STATE_LOAD_ASSETS
			Case STATE_LOAD_ASSETS
				_model=New Model()

				currentState=STATE_START_GAME
				game.nextScreen = _model._mainMenuScreen
				game.screenFade.Start(50, true)
			Case STATE_START_GAME
			
		End
    End
             
    Method Render:Void()
		Cls 0,0,0
		DrawText("SUPER MATHS ADVENTURE", SCREEN_WIDTH2, SCREEN_HEIGHT2, 0.5,0.5)
		DrawText("LOADING...", SCREEN_WIDTH2, SCREEN_HEIGHT2+50, 0.5,0.5)
     End
End
